﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading;

namespace Update
{
    public static class Resources
    {
        static ResourceManager resourceMan;
        public static ResourceManager ResourceManager
        {
            get
            {
                if (resourceMan is null)
                {
                    resourceMan = new ResourceManager(typeof(Resources).FullName, typeof(Resources).Assembly);
                }
                return resourceMan;
            }
        }
        public static string Translate(string text)
        {
            try
            {
                text = ResourceManager.GetString(text);
            }
            catch (Exception)
            {

            }
            return text;
        }
        /// <summary>
        /// 获取左小（圆）括号
        /// </summary>
        public static char LeftParenthesis
        {
            get
            {
                switch (Thread.CurrentThread.CurrentCulture.Name)
                {
                    case "zh-CN":
                        return '（';
                    default:
                        return '(';
                }
            }
        }
        /// <summary>
        /// 获取右小（圆）括号
        /// </summary>
        public static char RightParenthesis
        {
            get
            {
                switch (Thread.CurrentThread.CurrentCulture.Name)
                {
                    case "zh-CN":
                        return '）';
                    default:
                        return ')';
                }
            }
        }
        /// <summary>
        /// 获取冒号分隔表达式
        /// </summary>
        public static string ColonSeparate
        {
            get
            {
                switch (Thread.CurrentThread.CurrentCulture.Name)
                {
                    case "zh-CN":
                        return "：";
                    default:
                        return ": ";
                }
            }
        }
    }
}
